#pragma once

#include <acml.h>
#include "shm_array.h"

template <typename T> struct shm_array_type_map;
template <shm_array_type_t> struct shm_array_type_invmap;

#define make_shm_array_type_map(_ctype_,enumtype) \
template<> struct shm_array_type_map <_ctype_>{ \
	typedef _ctype_ ctype ; \
	static const shm_array_type_t type = shm_array_ ##enumtype; \
};

#define make_shm_array_type_invmap(enumtype,_ctype_) \
template<> struct shm_array_type_invmap <shm_array_ ##enumtype>{ \
	typedef _ctype_ ctype;\
	static const shm_array_type_t type = shm_array_ ##enumtype; \
};

#define shm_array_type_link(ctype,enumtype) \
	make_shm_array_type_map(ctype,enumtype) \
	make_shm_array_type_invmap(enumtype,ctype)

shm_array_type_link(char,char)
shm_array_type_link(int,int32)
shm_array_type_link(long,int64)
shm_array_type_link(float,float)
shm_array_type_link(double,double)
shm_array_type_link(cplxf,cplxf)
shm_array_type_link(cplxd,cplxd)

make_shm_array_type_map(complex,cplxf)
make_shm_array_type_map(doublecomplex,cplxd)

